<?php

/**
 * This is the model class for table "secondary_stair_or_fire_escape".
 *
 * The followings are the available columns in table 'secondary_stair_or_fire_escape':
 * @property integer $id
 * @property integer $number
 * @property string $width
 * @property string $units_of_measurement_of_the_width
 * @property string $stair_construction
 * @property integer $railing_provided
 * @property string $rp_made_of
 * @property string $location
 * @property integer $exit_accesible
 * @property integer $any_obstruction
 * @property string $termination_or_discharge_of_exit
 * @property integer $exit_enclosure_provided
 * @property string $enclosure_construction
 * @property integer $any_opening
 * @property integer $opening_protected
 * @property integer $fire_door_provided
 * @property string $fdp_width
 * @property string $units_of_measurement_of_fdp_width
 * @property string $fire_door_construction
 * @property integer $door_provided_with_vision_panel
 * @property string $if_yes_made_of
 * @property integer $door_equipped_with_self_closing_device
 * @property integer $door_and_enclosure_proper_rating
 * @property integer $door_open_easily
 * @property integer $self_closing_device_operable
 * @property integer $door_equipped_with_panic_hardware
 * @property integer $operable
 * @property integer $door_swing_in_the_direction_of_exit_travel
 * @property integer $enclosure_properly_protected
 * @property string $fire_escape_pressurized
 * @property string $pressurized_type_of_method
 * @property string $date_last_tested
 * @property integer $investigation_establishment_id
 * @property integer $investigation_general_information_id
 * @property integer $exit_detail_id
 *
 * The followings are the available model relations:
 * @property ExitDetail $exitDetail
 */
class SecondaryStairOrFireEscape extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return SecondaryStairOrFireEscape the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
const a = "Interior";
const b ="Exterior";
public function getLocation(){
return array(
self::a=>"Interior",
self::b=>"Exterior"
);


}
	const c = "Foot";
const d ="Inches";
public function getMeasurement(){
return array(
self::c=>"Foot",
self::d=>"Inches"
);


}
		const e = "Foot";
const f ="Inches";
public function getMeasurementa(){
return array(
self::e=>"Foot",
self::f=>"Inches"
);


}
	const g = "Yes";
const h ="No";
const i ="N/A";
public function getPres(){
return array(
self::g=>"Yes",
self::h=>"No",
self::i=>"N/A"
);


}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'secondary_stair_or_fire_escape';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('investigation_establishment_id, investigation_general_information_id, exit_detail_id', 'required'),
			array('number, railing_provided, exit_accesible, any_obstruction, exit_enclosure_provided, any_opening, opening_protected, fire_door_provided, door_provided_with_vision_panel, door_equipped_with_self_closing_device, door_and_enclosure_proper_rating, door_open_easily, self_closing_device_operable, door_equipped_with_panic_hardware, operable, door_swing_in_the_direction_of_exit_travel, enclosure_properly_protected, investigation_establishment_id, investigation_general_information_id, exit_detail_id', 'numerical', 'integerOnly'=>true),
			array('width, fdp_width', 'length', 'max'=>11),
			array('units_of_measurement_of_the_width, units_of_measurement_of_fdp_width', 'length', 'max'=>6),
			array('location', 'length', 'max'=>8),
			array('fire_escape_pressurized', 'length', 'max'=>3),
			array('stair_construction, rp_made_of, termination_or_discharge_of_exit, enclosure_construction, fire_door_construction, if_yes_made_of, pressurized_type_of_method, date_last_tested', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, number, width, units_of_measurement_of_the_width, stair_construction, railing_provided, rp_made_of, location, exit_accesible, any_obstruction, termination_or_discharge_of_exit, exit_enclosure_provided, enclosure_construction, any_opening, opening_protected, fire_door_provided, fdp_width, units_of_measurement_of_fdp_width, fire_door_construction, door_provided_with_vision_panel, if_yes_made_of, door_equipped_with_self_closing_device, door_and_enclosure_proper_rating, door_open_easily, self_closing_device_operable, door_equipped_with_panic_hardware, operable, door_swing_in_the_direction_of_exit_travel, enclosure_properly_protected, fire_escape_pressurized, pressurized_type_of_method, date_last_tested, investigation_establishment_id, investigation_general_information_id, exit_detail_id', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'exitDetail' => array(self::BELONGS_TO, 'ExitDetail', 'exit_detail_id'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'number' => 'Number',
			'width' => 'Width',
			'units_of_measurement_of_the_width' => 'Units Of Measurement Of The Width',
			'stair_construction' => 'Stair Construction',
			'railing_provided' => 'Railing Provided',
			'rp_made_of' => 'Rp Made Of',
			'location' => 'Location',
			'exit_accesible' => 'Exit Accesible',
			'any_obstruction' => 'Any Obstruction',
			'termination_or_discharge_of_exit' => 'Termination Or Discharge Of Exit',
			'exit_enclosure_provided' => 'Exit Enclosure Provided',
			'enclosure_construction' => 'Enclosure Construction',
			'any_opening' => 'Any Opening',
			'opening_protected' => 'Opening Protected',
			'fire_door_provided' => 'Fire Door Provided',
			'fdp_width' => 'Fdp Width',
			'units_of_measurement_of_fdp_width' => 'Units Of Measurement Of Fdp Width',
			'fire_door_construction' => 'Fire Door Construction',
			'door_provided_with_vision_panel' => 'Door Provided With Vision Panel',
			'if_yes_made_of' => 'If Yes Made Of',
			'door_equipped_with_self_closing_device' => 'Door Equipped With Self Closing Device',
			'door_and_enclosure_proper_rating' => 'Door And Enclosure Proper Rating',
			'door_open_easily' => 'Door Open Easily',
			'self_closing_device_operable' => 'Self Closing Device Operable',
			'door_equipped_with_panic_hardware' => 'Door Equipped With Panic Hardware',
			'operable' => 'Operable',
			'door_swing_in_the_direction_of_exit_travel' => 'Door Swing In The Direction Of Exit Travel',
			'enclosure_properly_protected' => 'Enclosure Properly Protected',
			'fire_escape_pressurized' => 'Fire Escape Pressurized',
			'pressurized_type_of_method' => 'Pressurized Type Of Method',
			'date_last_tested' => 'Date Last Tested',
			'investigation_establishment_id' => 'Investigation Establishment',
			'investigation_general_information_id' => 'Investigation General Information',
			'exit_detail_id' => 'Exit Detail',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('number',$this->number);
		$criteria->compare('width',$this->width,true);
		$criteria->compare('units_of_measurement_of_the_width',$this->units_of_measurement_of_the_width,true);
		$criteria->compare('stair_construction',$this->stair_construction,true);
		$criteria->compare('railing_provided',$this->railing_provided);
		$criteria->compare('rp_made_of',$this->rp_made_of,true);
		$criteria->compare('location',$this->location,true);
		$criteria->compare('exit_accesible',$this->exit_accesible);
		$criteria->compare('any_obstruction',$this->any_obstruction);
		$criteria->compare('termination_or_discharge_of_exit',$this->termination_or_discharge_of_exit,true);
		$criteria->compare('exit_enclosure_provided',$this->exit_enclosure_provided);
		$criteria->compare('enclosure_construction',$this->enclosure_construction,true);
		$criteria->compare('any_opening',$this->any_opening);
		$criteria->compare('opening_protected',$this->opening_protected);
		$criteria->compare('fire_door_provided',$this->fire_door_provided);
		$criteria->compare('fdp_width',$this->fdp_width,true);
		$criteria->compare('units_of_measurement_of_fdp_width',$this->units_of_measurement_of_fdp_width,true);
		$criteria->compare('fire_door_construction',$this->fire_door_construction,true);
		$criteria->compare('door_provided_with_vision_panel',$this->door_provided_with_vision_panel);
		$criteria->compare('if_yes_made_of',$this->if_yes_made_of,true);
		$criteria->compare('door_equipped_with_self_closing_device',$this->door_equipped_with_self_closing_device);
		$criteria->compare('door_and_enclosure_proper_rating',$this->door_and_enclosure_proper_rating);
		$criteria->compare('door_open_easily',$this->door_open_easily);
		$criteria->compare('self_closing_device_operable',$this->self_closing_device_operable);
		$criteria->compare('door_equipped_with_panic_hardware',$this->door_equipped_with_panic_hardware);
		$criteria->compare('operable',$this->operable);
		$criteria->compare('door_swing_in_the_direction_of_exit_travel',$this->door_swing_in_the_direction_of_exit_travel);
		$criteria->compare('enclosure_properly_protected',$this->enclosure_properly_protected);
		$criteria->compare('fire_escape_pressurized',$this->fire_escape_pressurized,true);
		$criteria->compare('pressurized_type_of_method',$this->pressurized_type_of_method,true);
		$criteria->compare('date_last_tested',$this->date_last_tested,true);
		$criteria->compare('investigation_establishment_id',$this->investigation_establishment_id);
		$criteria->compare('investigation_general_information_id',$this->investigation_general_information_id);
		$criteria->compare('exit_detail_id',$this->exit_detail_id);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}